var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (e, a) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, e) {
              t.__proto__ = e;
            }) ||
          function (t, e) {
            for (var a in e)
              Object.prototype.hasOwnProperty.call(e, a) && (t[a] = e[a]);
          })(e, a);
      };
      return function (e, a) {
        function l() {
          this.constructor = e;
        }
        if ("function" != typeof a && null !== a)
          throw new TypeError(
            "Class extends value " + String(a) + " is not a constructor or null"
          );
        t(e, a),
          (e.prototype =
            null === a
              ? Object.create(a)
              : ((l.prototype = a.prototype), new l()));
      };
    })(),
  LookFuJiangView = (function (t) {
    function e() {
      var e = t.call(this) || this;
      return (
        e.btn_lookClose1.on(Laya.Event.CLICK, e, e.clickHandler),
        WebSocketService.addListener({
          caller: e,
          code: 2098,
          method: e.onLoadFuJIangData,
        }),
        e
      );
    }
    return (
      __extends(e, t),
      (e.showHeroDetailDialog = function (t, a) {
        return (
          null == this.lookV &&
            ((this.lookV = new e()),
            (this.lookV.zOrder = 2e3),
            (this.lookV.x = 37),
            (this.lookV.y = 100)),
          Laya.stage.addChild(this.lookV),
          (this.lookV.heroJson = t),
          (this.lookV.className = ""),
          (this.lookV.className = a),
          WebSocketService.send({ c: 2098, d: { id: t.id } }),
          this.lookV
        );
      }),
      (e.prototype.dealSuboardStar = function (t) {
        var e = "";
        return t > 0 && (e = " (" + t + "星) "), e;
      }),
      (e.prototype.initUI = function () {
        var t = this.heroJson.data;
        (this.label_hdd_title1.text =
          t.name + " (" + t.lvl + "级）" + this.dealSuboardStar(t.star)),
          "AXFlyMyMarketView" == this.className &&
            (this.label_hdd_title1.text =
              t.name + "(" + t.trans + "转）" + this.dealSuboardStar(t.star)),
          (this.img_heroDetail_header1.skin =
            "fujiangfull/fujiang_" + t.img + ".png");
        var e = t.npcInit;
        (this.label_hdd_touxian1.text = "头衔：" + t.title),
          (this.label_hdd_qixue1.text = "气血：" + t.hp + "/" + t.maxHp),
          (this.label_hdd_jingli1.text = "精力：" + t.mp + "/" + t.maxMp),
          (this.label_hdd_gongji1.text = "攻击：" + t.ap),
          (this.label_hdd_fangyu1.text = "防御：" + t.df),
          (this.label_hdd_sudu1.text = "速度：" + t.sp),
          (this.label_hdd_jineng11.text = "技能1："),
          (this.label_hdd_jineng21.text = "技能2：");
        for (var a = 0; a < t.skillList.length; a++) {
          var l = t.skillList[a],
            i = l.name,
            o = l.hua,
            n = l.grade,
            s = l.useCount,
            h = "";
          o > 0 && (h = "化境" + n),
            (h = (h = h + i + "  ") + s + "熟练度"),
            0 == a
              ? (this.label_hdd_jineng11.text = "技能1：" + h)
              : (this.label_hdd_jineng21.text = "技能2：" + h);
        }
        (this.label_hdd_czl1.text = "成长率：" + e.czl + "/" + e.czlMax),
          (this.label_hdd_maxHp1.text = "气血初值：" + e.hp + "/" + e.hpMax),
          (this.label_hdd_maxMp1.text = "精力初值：" + e.mp + "/" + e.mpMax),
          (this.label_hdd_maxAp1.text = "攻击初值：" + e.ap + "/" + e.apMax),
          (this.label_hdd_maxSp1.text = "速度初值：" + e.sp + "/" + e.spMax),
          (this.label_hdd_tzd1.text = "体质点：" + t.hpp),
          (this.label_hdd_zld1.text = "智力点：" + t.mpp),
          (this.label_hdd_lld1.text = "力量点：" + t.app),
          (this.label_hdd_mjd1.text = "敏捷点：" + t.spp);
      }),
      (e.prototype.onLoadFuJIangData = function (t) {
        0 == t.code && ((this.heroJson = t), this.initUI());
      }),
      (e.prototype.clickHandler = function () {
        this.removeSelf();
      }),
      e
    );
  })(ui.EmailController.LookFuJiangViewUI);
